package com.logic.modular.act.battle.vo;

import com.comment.validation.ArraySize;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

public class BattleVo {
    /**
     * 对局匹配vo
     */
    public static class pvpMatchVo{
        @Data
        public static class realPersonMatchQuick {
            @NotNull(message = "地图id不能为空")
            @Min(value = 1, message = "地图id必须大于1")
            @ApiModelProperty("地图id")
            private Integer mapId;

            @NotNull(message = "开始人数不能为空")
            @ApiModelProperty("开始人数")
            private Integer startThreshold;
        }

        @Data
        public static class select {
            @NotNull(message = "对局id不能为空")
            @ApiModelProperty("对局id")
            private Long matchId;
        }

        @Data
        @AllArgsConstructor
        @NoArgsConstructor
        public static class tryAlliance {
            private Long playerId;
        }

        @Data
        public static class refuse {
            @NotNull(message = "no不能为空")
            @ApiModelProperty("no")
            private String no;
        }

        @Data
        public static class listMatchEnd {
            private Long matchId;

            private Long mapId;
        }

        @Data
        public static class manMachineMatch {
            @NotNull(message = "地图id不能为空")
            @Min(value = 1, message = "地图id必须大于1")
            @ApiModelProperty("地图id")
            private Long mapId;

            @NotNull(message = "开始人数不能为空")
            @ApiModelProperty("开始人数")
            private Integer startThreshold;
        }
    }

    /**
     * 局内路线vo
     */
    public static class PvpLinkVo{
        @Data
        public static class bfsVo {
            private   Long playerId;
            @NotNull(message = "起始城池不能为空")
            @ApiModelProperty(value = "起始城池", required = true)
            private Integer startCityId;

            @NotNull(message = "目标城池不能为空")
            @ApiModelProperty(value = "目标城池", required = true)
            private Integer targetCityId;
        }
    }

    /**
     * 局内武将vo
     */
    public static class PvpHeroVo {
        @Data
        public static class RankNo {
            @NotNull(message = "队伍编号不能为空")
            @ApiModelProperty("队伍编号")
            @Min(value = 1, message = "队伍编号必须大于1")
            @Max(value = 5, message = "队伍编号必须小于5")
            private Integer rankNo;
        }

        @Data
        public static class BuBingByWuJiang {
            @NotNull(message = "core武将id不能为空")
            @ApiModelProperty(value = "core武将id", required = true)
            private Long coreHeroId;
            @NotNull(message = "兵力-数量不能为空")
            @ApiModelProperty(value = "兵力-数量", required = true)
            private Long troopsQuantity;
        }

        @Data
        public static class selectByBattle {
            @NotNull(message = "战斗id不能为空")
            @ApiModelProperty(value = "战斗id", required = true)
            private Long battleId;
        }
    }

    /**
     * 城池建筑vo
     */
    public static class PvpCityVo{
        @Data
        public static class transport {
            @NotNull(message = "运输的兵力不能为空")
            @ApiModelProperty(value = "兵力-数量", required = true)
            private Integer troopsQuantity;

            @NotNull(message = "起始城池不能为空")
            @ApiModelProperty(value = "起始城池" , required = true)
            private Long startCityId;

            @NotNull(message = "目标城池不能为空")
            @ApiModelProperty(value = "目标城池" , required = true)
            private Long targetCityId;

        }

        @Data
        public static class list {
            Long ownerUid;
            Long coreCityId;
            Integer type;
        }
    }

    /**
     * 内政建筑vo
     */
    public static class PvpCityBuildVo{
        @Data
        public static class targetCityId {
            @ApiModelProperty("目标城池")
            private Integer targetCityId;
        }

        @Data
        public static class build{
            @NotNull(message = "目标城池不能为空")
            @ApiModelProperty("目标城池")
            private Long targetCityId;
            @NotNull(message = "内政城池编号不能为空")
            @ApiModelProperty("内政城池编号")
            private Integer cityBuildNo;
            @NotNull(message = "内政建筑id不能为空")
            @ApiModelProperty("内政建筑id")
            private Long coreCityBuildingId;
        }
        @Data
        public static class upgrade{
            @ApiModelProperty("目标城池")
            private Long targetCityId;
            @ApiModelProperty("内政城池编号")
            private Integer cityBuildNo;
        }
        @Data
        public static class remove{
            @ApiModelProperty("目标城池")
            private Long targetCityId;
            @ApiModelProperty("内政城池编号")
            private Integer cityBuildNo;
        }

        @ApiModel("对内政建筑使用道具")
        @Data
        public static class userProp2005 {
            @ApiModelProperty("目标城池")
            private Long targetCityId;
            @ApiModelProperty("内政城池编号")
            private String no;
        }
    }

    /**
     * 局内队伍vo
     */
    public static class PvpRanksVo {
        @Data
        public static class RankNo {
            @NotNull(message = "队伍编号不能为空")
            @ApiModelProperty("队伍编号")
            @Min(value = 1, message = "队伍编号必须大于1")
            @Max(value = 5, message = "队伍编号必须小于5")
            private Integer rankNo;
        }
        @Data
        @EqualsAndHashCode(callSuper = true)
        public static class Formation extends RankNo{
            @NotNull(message = "武将1不能为空")
            @ApiModelProperty("武将1")
            private Long heroId1;
            @NotNull(message = "武将2不能为空")
            @ApiModelProperty("武将2")
            private Long heroId2;
            @NotNull(message = "武将3不能为空")
            @ApiModelProperty("武将3")
            private Long heroId3;
        }

        @Data
        public static class Formation2 {
            @NotNull(message = "队伍编号不能为空")
            @ApiModelProperty("队伍编号")
            @Min(value = 1, message = "队伍编号必须大于1")
            @Max(value = 5, message = "队伍编号必须小于5")
            private Integer rankNo;

            @ApiModelProperty("行:队伍位置, 列:1英雄id,2兵力")
            // @ArraySize(min = 3, max = 3, message = "长度只能为3")
            private Long[][] rankInfo;
        }


        @Data
        public static class ToCityVo{
            @NotNull(message = "队伍编号不能为空")
            @ApiModelProperty("队伍编号")
            @Min(value = 1, message = "队伍编号必须大于1")
            @Max(value = 5, message = "队伍编号必须小于5")
            private Integer rankNo;

            @NotNull(message = "目标城池不能为空")
            @ApiModelProperty("目标城池")
            private Long targetCityId;
        }

        @Data
        public static class uninstallation {
            private int rankNo;
            private int[] rankOrder;
        }

        @Data
        public static class teamPositionEditing {
            @NotNull
            private int rankNo;
            @ArraySize(min = 3, max = 3, message = "长度只能为3")
            private int[] rankOrder;
        }

    }


    /**
     * 玩家对战信息
     */
    public static class PvpMessageVo{
        @Data
        public static class Base {
            @NotNull(message = "战斗信息id")
            @ApiModelProperty(value = "战斗信息id", required = true)
            private Long battleId;
        }
    }

    public static class TeamVo {
        @Data
        public static class CreateTeam {
        }
    }
}
